package com.tsx.utils;

import com.itextpdf.io.font.PdfEncodings;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.font.PdfFontFactory;

import java.net.URL;

public class PdfFontUtil {
    public static PdfFont chinesePdfFont() throws Exception {
        URL resource = PdfFontUtil.class.getClassLoader().getResource("simhei.ttf");
        return PdfFontFactory.createFont(resource.getPath(), PdfEncodings.IDENTITY_H);
    }
}
